﻿<%@ Assembly Name="JM.JCY.SharePointComponent, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a3f76d78e78426e2" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserListUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.UserManagement.UserList.UserListUserControl" %>
<%@ Register Src="../LeftMenu/LeftMenuUserControl.ascx" TagName="LeftMenuUserControl"
    TagPrefix="uc1" %>
<script type="text/javascript">
    $(document).ready(function () {
        var lbCreate = $("#<%=lbCreate.ClientID %>");
        lbCreate.live('click', function () {
            location.href = "CreateUser.aspx";
            return false;
        });
    });
    //29 Jul 2011 - Resolve issue:  when input Enter key, the page redirect to MySite/default.aspx page issue
    document.onkeydown = function (e) {
        switch ((window.event) ? event.keyCode : e.which) {
            case 13:
                event.keyCode = 9;
                event.returnValue = false;
                document.getElementById('<%= imgSearch.ClientID %>').focus();
                document.getElementById('<%= imgSearch.ClientID %>').click();
                break;
            default:
                break;
        }
    }

    function RedirectToEditUser(sender, UserId) {

        sender.href = "EditUser.aspx?UserId=" + UserId;
    }

    function popup(URL) {
        window.open(URL, null, "width=620,height=700,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizeable=no,directories=no");
    }

</script>
<div>
    <table class="main">
        <tr>
            <td valign="top" width="25%" runat="server" id="tdLeftMenu">
                <uc1:leftmenuusercontrol id="LeftMenuUserControl1" runat="server" />
            </td>
            <td valign="top" width="75%" runat="server" id="tdContent">
                <table class="content" width="98%">
                    <tr>
                        <td style="padding: 5px;">
                            <table width="100%" class="title">
                                <tr>
                                    <td width="60%">
                                        <h2 class="title">
                                            <asp:Label ID="lblTitle" runat="server" Text="用户管理"></asp:Label>
                                        </h2>
                                    </td>
                                    <td align="right" width="40%">
                                        <img runat="server" id="imgEdit" src="/_layouts/JM.JCY.Resource/images/plus.png"
                                            width="15" />
                                        <asp:LinkButton ID="lbCreate" runat="server" Visible="true" class="link">创建新用户</asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <br />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table width="100%" class="form">
                                <tr>
                                    <td width="26%">
                                        <b>姓名</b>
                                    </td>
                                    <td width="1%">
                                        :
                                    </td>
                                    <td width="73%">
                                        <asp:TextBox ID="txtName" runat="server" MaxLength="100" Width="330"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <b>部门科室</b>
                                    </td>
                                    <td>
                                        :
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlDept" runat="server" AppendDataBoundItems="true" Width="340">
                                            <asp:ListItem Text="请选择一个部门..." Value="0" Selected="True" />
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                            
                  
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <asp:ImageButton ID="imgSearch" runat="server" 
                                ImageUrl="~/_layouts/JM.JCY.Resource/images/search.png" onclick="imgSearch_Click" 
                                />
                            <asp:ImageButton ID="imgReset" runat="server" ImageUrl="~/_layouts/JM.JCY.Resource/images/reset.png" Visible="false" />
                            <%--<asp:ImageButton ID="imgCancel" runat="server" ImageUrl="~/_layouts/JM.JCY.Resource/images/cancel.png" />--%>
                            
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <hr id="hr1" style="display: none;" />
                            <%--<span id="spResult" class="NoRecordMsg">No record found</span>--%>
                            <table width="100%">
                            <tr><td>
                            
                            
                          <asp:GridView ID="gvUserList" runat="server" AutoGenerateColumns="False" BorderWidth="0px"
                                    GridLines="Horizontal" CssClass="altrowstablebc" Width="100%" 
                                    EnableModelValidation="True" PageSize="20" AllowPaging="True"
                                    onpageindexchanging="gvUserList_PageIndexChanging" 
                                    onrowdatabound="gvUserList_RowDataBound">
                              <Columns>
                              
                                  <asp:TemplateField>
                                  <ItemTemplate>
                                       <hr runat="server" id="hr" />
                                                    <table width="100%" class="profile">
                                                        <tr>
                                                            <td width="110" valign="top">
                                                                <asp:Image ID="imgPhoto" runat="server" ImageUrl='<%# Eval("PhotoImagePath") %>'
                                                                    Width="100" />
                                                            </td>
                                                            <td align="left">
                                                                <table>
                                                                    <tr>
                                                                        <td>
                                                                            <asp:LinkButton ID="lbName" runat="server" CssClass="link" Text='<%# Eval("UserName") %>'
                                                                                OnClientClick='<%# String.Format("RedirectToEditUser({0},{1})","this",Eval("ID")) %>'></asp:LinkButton>
                                                                            <asp:Label ID="lblStaffId" runat="server" Text='<%# Eval("ID") %>' Visible="false"></asp:Label>
                                                                            <asp:Label ID="lblId" runat="server" Text='<%# Eval("id1") %>' Visible="false"></asp:Label>
                                                                            <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>' Visible="false"></asp:Label>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            <asp:Literal ID="ltDesignation" runat="server"></asp:Literal>
                                                                        </td>
                                                                    </tr>
                                                                
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                  </ItemTemplate>
                                  </asp:TemplateField>
                              </Columns>




                            </asp:GridView>
                         </td></tr>
                    
                         
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<asp:HiddenField ID="hfNoMenu" runat="server" Value="N" />
<asp:HiddenField ID="hfContextId" runat="server" />
